<template>
  <div>

  </div>
</template>

<script>
import { mapGetters } from 'vuex';
export default {
  data() {
    return {
    }
  },
  methods: {
    getRouteName() {
      const myRoute = this.permission_routes.find(item => item.name === "my");
      if (myRoute) {
        const myIndexRoute = myRoute.children.find(c => c.name === "myIndex");
        if (myIndexRoute) {
          return "myIndex";
        }
      }
      const routeName = this.permission_routes.find(item => !item.hidden && item.children).name;
      return routeName;
    }
  },
  mounted() {
    const routeName = this.getRouteName();
    // const routeName = this.permission_routes.find(item => !item.hidden && item.children).name;
    this.$router.push({ name: routeName });
  },
  computed: {
    ...mapGetters([
      'permission_routes'
    ]),
  }
}
</script>

<style lang="scss" scoped>
</style>
